<script type="text/javascript">
	function camelToUnderline(s){
		return s.replace(/([A-Z])/g,"_$1").toUpperCase();
	}
	function underlineToCamel(s){
		return s.toLowerCase().replace(/\_(\w)/g, function(all,letter){
          return letter.toUpperCase();
        });
	}
	function g(id){
		return document.getElementById(id);
	}
</script>
camel:<textarea id="camel"></textarea><button onclick="javascript:g('underline').value=camelToUnderline(g('camel').value);">ת</button><br />
underline:<textarea id="underline"></textarea><button onclick="javascript:g('camel').value=underlineToCamel(g('underline').value);">ת</button><br />